<script type="text/javascript">
    featuredcontentglider.init({
        gliderid: "mainnews", //ID of main glider container
        contentclass: "glidecontent", //Shared CSS class name of each glider content
        togglerid: "p-select", //ID of toggler container
        remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
        selected: 0, //Default selected content index (0=1st)
        persiststate: false, //Remember last content shown within browser session (true/false)?
        speed: <?php echo $SPEED; ?>, //Glide animation duration (in milliseconds)
        direction: "<?php echo $MOVE; ?>", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
        autorotate: true, //Auto rotate contents (true/false)?
        autorotateconfig: [3000, 2] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
    })
</script>
<div id="mainnews" class="glidecontentwrapper">
    <?php
    $GLIDE_LIMIT=5;
    if(strlen($WORDS_CNT)<1)
        $WORDS_CNT = 300;
    $rs_nlist = $cquery->getContentByCatLimit($GLIDE_CAT, 0,5);
    $piximg= array($GLIDE_LIMIT);
    $i=0;
    foreach($rs_nlist as $newsH) {
        $url = $fxn->processURL("page", $newsH["content_id"], $newsH["page_title"], $newsH["direct_link"]);
        ?>
    <div class="glidecontent">
            <?php $pix = $cquery->getFirstImageResourceContent($newsH["content_id"]);
            if(strlen($pix)>3) {
                ?>
        <a href="<?php echo $url;?>" title="<?php echo $newsH["ptitle"]; ?>">


            <img name="" src="<?php echo $HOME_URL; ?>resources/image.php?s=<?php echo $GLIDE_BIG_THUMB; ?>&im=<?php echo $pix; ?>"  alt="" class="imgleft">
        </a>
                <?php } ?>        <span class="nhead">
            <a href="<?php echo $url;?>" title="<?php echo $newsH["page_title"]; ?>">
                    <?php echo $newsH['page_title'];?></a></span>
        <span class="smalltxt"><?php echo $fxn->getSmallContents($newsH["page_content"], $WORDS_CNT);?>
            <a href="<?php echo $url; ?>" class="readmore">readmore</a>
        </span>
            <?php
            $piximg[$i]= $pix;
            $i++;
            ?>
    </div>
        <?php } ?>

    <div id="p-select" class="glidecontenttoggler">
        <?php if(strtoupper($GLIDE_TAB) == ("COUNT")) {
    unset($piximg); ?>
        <a href="#" class="prev"> &laquo; </a>
    <?php for($j=0;$j<$i;$j++) { ?>
        <a href="#" class="toc"><?php echo $j+1;?></a>
        <?php } ?>
        <a href="#" class="next">&raquo;</a>

            <?php } else if($GLIDE_TAB == strtoupper("img")) { ?>
    <?php for($j=0;$j<$i;$j++) { ?>
        <a href="#" class="toc">
           <?php if(strlen($piximg[$j])>0) { ?>
            <img name="" src="<?php echo $HOME_URL; ?>resources/image.php?s=<?php echo $GLIDE_SMALL_THUMB; ?>&im=<?php echo $piximg[$j]; ?>"  alt="" class="">
            <?php } else {
                echo "&loz;";} ?>  </a>
        <?php } unset
    ($piximg); ?>
        <a href="#" class="prev"> &laquo; </a>
        <a href="#" class="next">&raquo;</a>

            <?php } else if (strtolower($GLIDE_TAB) == ("img_count")) {
    ?><a href="#" class="prev"> &laquo; </a>
    <?php for($j=0;$j<$i;$j++) { ?>
        <a href="#" class="toc">
            <?php if(strlen($piximg[$j])>0) { ?>
            <img name="" src="<?php echo $HOME_URL; ?>resources/image.php?s=<?php echo $GLIDE_SMALL_THUMB; ?>&im=<?php echo $piximg[$j]; ?>"  alt="" class="">
            <?php } else {
                echo "&loz;";} ?>
        </a>
        <?php } unset    ($piximg); ?>

        <a href="#" class="next">&raquo;</a>

            <?php
}else {
            unset($piximg); ?>
        <a href="#" class="prev"> &laquo; </a>
            <?php for($j=0;$j<$i;$j++) { ?>
        <a href="#" class="toc"><?php echo $GLIDE_TAB;?></a>
        <?php } ?>
        <a href="#" class="next">&raquo;</a>
    <?php } ?>
    </div>
</div>
